home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
program
/
4cmp22s.zip
/
FACIL2.4TH
< prev
next >
Wrap
Text File
|
1994-10-30
|
1KB
|
30 lines
\ Forth Compiler, ANS FORTH FACILITY WORDS
\ Copyright 1994 by Thomas Almy. All rights reserved.
\ Include this file before FORTHLIB
\ When used with DISPLAY, include DISPLAY2 before FACIL2
10 HEX
UNDEF AT-XY CODE AT-XY
AL DH MOV BL DL MOV BH BH XOR 2 # AH MOV 10 INT RET END-CODE [THEN]
UNDEF PAGE CODE PAGE
CX CX XOR CX ES >SEG ES: 44A [] DL MOV DL DEC ES: 484 [] DH MOV
DH DX OR =0 IF, 18 # DH MOV THEN, 7 # BH MOV 600 # AX MOV
10 INT RET END-CODE [THEN]
U: MS [DECIMAL] 182 10000 [HEX] */ 0 0 46C 2@L SWAP D+
BEGIN 2DUP 0 46C 2@L SWAP D< UNTIL 2DROP ;
UNDEF TIME&DATE CODE TIME&DATE SI POP
2C # AH MOV 21 INT AX AX XOR DH AL MOV AX PUSH
CL AL MOV AX PUSH CH AL MOV AX PUSH
2A # AH MOV 21 INT AX AX XOR DL AL MOV AX PUSH
DH AL MOV AX PUSH CX PUSH SI JMPI END-CODE [THEN]
?DEFINE EKEY ?DEFINE EKEY? OR [IF] \ define these if extended keys used
VARIABLE pchr -1 pchr !
U: KEY pchr @ 0< 0= IF pchr @ pchr ON EXIT THEN
BEGIN EKEY EKEY>CHAR 0= WHILE DROP REPEAT ;
U: KEY? pchr @ 0< 0= IF TRUE EXIT THEN
BEGIN EKEY? WHILE EKEY EKEY>CHAR IF pchr ! TRUE EXIT THEN DROP REPEAT FALSE ;
[THEN]
U: EKEY>CHAR DUP 100 >= IF DUP 103 = IF DROP 0 TRUE EXIT THEN FALSE EXIT THEN TRUE ;
U: EKEY 0 7 BDOS ?DUP 0= IF 0 7 BDOS 100 + THEN ;
U: EKEY? 0 0B BDOS 0<> ;
0A = [IF] DECIMAL [THEN]